home *** CD-ROM | disk | FTP | other *** search
/ Nejlepší hry / Nejlepsi hry.iso / hry / sea of chaos / sea_install.msi / _15C39AAA7726369D39812BD40F01CF6A / _A18F7F4539CC471BA7C2842DD6E1BE14 < prev    next >
Text File  |  2004-11-20  |  574b  |  30 lines

  1. //simple shader: combine color and texture sample and add in "extra" color
  2. //Luke Lenhart
  3. //(C)2004-2005 Digipen Institute of Technology
  4.  
  5. //cloud sampler
  6. sampler2D sampTex;
  7.  
  8. //"extra" color to add to final color
  9. float4 clrExtra;
  10.  
  11. //shader input
  12. struct PS_INPUT
  13. {
  14.     float4 Color : COLOR;
  15.     float2 Tex0 : TEXCOORD0;
  16. };
  17.  
  18. //shader code
  19. float4 PShader(PS_INPUT In) : COLOR
  20. {
  21.     //sample textutes
  22.     float4 texclr=tex2D(sampTex,In.Tex0);
  23.     
  24.     //blend with vert color
  25.     float4 clr=texclr*In.Color + clrExtra*In.Color.a;
  26.     
  27.     //spit out color
  28.     return clr;
  29. }
  30.